package com.eightgroups.tces.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.eightgroups.tces.entity.CoursePlan;
import com.eightgroups.tces.entity.CoursePlanVo;
import com.eightgroups.tces.mapper.CoursePlanMapper;
import com.eightgroups.tces.service.ICoursePlanService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 开课信息 服务实现类
 * </p>
 *
 * @author zzc2016.cn
 * @since 2017-11-27
 */
@Service
public class CoursePlanServiceImpl extends ServiceImpl<CoursePlanMapper, CoursePlan> implements ICoursePlanService {
    @Autowired
    private CoursePlanMapper coursePlanMapper;
    @Override
    public Page<CoursePlanVo> selectPageVo(Page<CoursePlanVo> page, EntityWrapper<CoursePlanVo> entityWrapper) {
        if (null != entityWrapper) {
            entityWrapper.orderBy(page.getOrderByField(), page.isAsc());
        }
        page.setRecords(coursePlanMapper.selectPageVo(page, entityWrapper));
        return page;
    }
}
